--- ./src/vt.c.orig	2013-09-24 23:02:31.000000000 +0000
+++ ./src/vt.c	2014-03-05 21:45:38.000000000 +0000
@@ -16,8 +16,13 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#ifdef __linux__
+#if defined(__linux__)
 #include <linux/vt.h>
+#elif defined(__unix__)
+#include <sys/param.h>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <sys/consio.h>
+#endif
 #endif
 
 #include "vt.h"
@@ -81,7 +86,7 @@
 void
 vt_set_active (gint number)
 {
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
     gint console_fd;
 
     g_debug ("Activating VT %d", number);
